var app = getApp();

Page({
  data: {

  },

  openPersonWin(){
    wx.navigateTo({
      url: './personal',
    })
  },

  setClick(){
    wx.navigateTo({
      url: './setPassword',
    })
  },

  logoutClick(){
    wx.showActionSheet({
      itemList: ['退出登录'],
      success(res) {
        if (res.tapIndex == 0){
          wx.showToast({ title: '退出登录成功！' }) 
          app.globalData.user = {};
          app.globalData.sessionid = '';
          app.globalData.driverName = '';
          app.globalData.driverAccount = '';
          app.globalData.driverCode = '';
          wx.removeStorage({
            key: 'xylc_session'
          })
          setTimeout(() => {
            wx.reLaunch({
              url: '../login/login'
            })
          }, 1200)
        }
      }
    })
  },

  onLoad: function (options) {
    var that = this;

    that.setData({
      name: app.globalData.driverName
    })
  },
  
  onShow: function () {

  },

  onHide: function () {

  },

  onPullDownRefresh: function () {

  },

  onReachBottom: function () {

  },

  onShareAppMessage: function () {

  }
})